const My={
  data(){
    return{ 
      navs:[
        {id:1, name:'首页',href:'/Home',icon:'van-icon-wap-home-o'},
        {id:2, name:'全部分类',href:'/Classify',icon:'van-icon-apps-o'},
        {id:3, name:'我的',href:'/My',icon:'van-icon-contact'},
      ],
    }
  },
  template:`  
  <div>
  <x-header>{{$route.meta.title}}</x-header>
  <div class="main classify">
  <div class="my" id="my">
    <div id="myorder">
      <div id="user">
        <label class="portrait">
          <input type="file">
          <img src="./image/avatar.svg" width="75" height="75" title="请放置一个75*75的图片" alt="">
        </label>
        <p class="username">阿伟</p>
        <p class="userphone">185****5168</p>
        <div class="account">账号管理<span>&#xe636;</span></div>
      </div>
      <div class="order">我的订单<span>更多</span><span>&nbsp;&#xe636;</span></div>
      <ul class="four-order">
      <li>&#xe609;<p>待付款</p></li>
      <li>&#xe771;<p>待收货</p></li>
      <li>&#xe635;<p>待评价</p></li>
      <li>&#xe607;<p>退货/退款</p></li>
    </ul>
    </div>
    <div class="mycoupon"><span>&#xe7ee;</span>&nbsp;我的优惠卷<div id="right-arrow">&#xe636;</div></div>
    <div class="mycoupon"><span>&#xe6df;</span>&nbsp;我的收藏<div id="right-arrow">&#xe636;</div></div>
    <div class="mycoupon"><span>&#xe628;</span>&nbsp;我的评价<div id="right-arrow">&#xe636;</div></div>
    <div class="mycoupon"><span>&#xe608;</span>&nbsp;我的收货地址<div id="right-arrow">&#xe636;</div></div>
  </div>
</div>
<x-tabbar :data="navs"></x-tabbar>
</div>`,
mounted(){

    
  document.querySelectorAll('.portrait').forEach(function(item){
var file=item.querySelector('[type="file"]');
var img = item.querySelector('img');
file.onchange = function(){
 
    try{
    img.src=window.URL.createObjectURL(this.files[0])
    resolve('成功插入');
  }catch(err){
    // console.log(err);
 
  }

  
}
})
}

}